package com.tongji.housediy.controller
{
	import com.tongji.housediy.events.UpdateFloorDataEvent;
	import com.tongji.housediy.model.FloorModel;
	
	import flashx.textLayout.tlf_internal;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenchao
	 * 
	 */
	public class UpdateFloorDataCommand extends Command
	{
		[Inject]
		public var event:UpdateFloorDataEvent;
		
		[Inject]
		public var model:FloorModel;
		
		override public function execute():void
		{
			if (event.type == UpdateFloorDataEvent.LOAD_ROOM_DATA)
				model.loadRoomData(event.dataSrc);
			else if (event.type == UpdateFloorDataEvent.LOAD_FLOOR_DATA)
				model.loadFloorData(event.dataSrc);
			else
				model.loadWallData(event.dataSrc);
		}
	}
}